/*
 * Selling Partner API for Tokens 
 *
 * The Selling Partner API for Tokens provides a secure way to access a customer's PII (Personally Identifiable Information). You can call the Tokens API to get a Restricted Data Token (RDT) for one or more restricted resources that you specify. The RDT authorizes subsequent calls to restricted operations that correspond to the restricted resources that you specified.  For more information, see the [Tokens API Use Case Guide](doc:tokens-api-use-case-guide).
 *
 * The version of the OpenAPI document: 2021-03-01
 * Generated by: https://github.com/openapitools/openapi-generator.git
 */


using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = software.amzn.spapi.Client.OpenAPIDateConverter;

namespace software.amzn.spapi.Model.tokens.v2021_03_01
{
    /// <summary>
    /// The request schema for the createRestrictedDataToken operation.
    /// </summary>
    [DataContract(Name = "CreateRestrictedDataTokenRequest")]
    public partial class CreateRestrictedDataTokenRequest : IValidatableObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="CreateRestrictedDataTokenRequest" /> class.
        /// </summary>
        [JsonConstructorAttribute]
        protected CreateRestrictedDataTokenRequest() { }
        /// <summary>
        /// Initializes a new instance of the <see cref="CreateRestrictedDataTokenRequest" /> class.
        /// </summary>
        /// <param name="targetApplication">The application ID for the target application to which access is being delegated..</param>
        /// <param name="restrictedResources">A list of restricted resources. Maximum: 50 (required).</param>
        public CreateRestrictedDataTokenRequest(string targetApplication = default(string), List<RestrictedResource> restrictedResources = default(List<RestrictedResource>))
        {
            // to ensure "restrictedResources" is required (not null)
            if (restrictedResources == null)
            {
                throw new ArgumentNullException("restrictedResources is a required property for CreateRestrictedDataTokenRequest and cannot be null");
            }
            this.RestrictedResources = restrictedResources;
            this.TargetApplication = targetApplication;
        }

        /// <summary>
        /// The application ID for the target application to which access is being delegated.
        /// </summary>
        /// <value>The application ID for the target application to which access is being delegated.</value>
        [DataMember(Name = "targetApplication", EmitDefaultValue = false)]
        public string TargetApplication { get; set; }

        /// <summary>
        /// A list of restricted resources. Maximum: 50
        /// </summary>
        /// <value>A list of restricted resources. Maximum: 50</value>
        [DataMember(Name = "restrictedResources", IsRequired = true, EmitDefaultValue = true)]
        public List<RestrictedResource> RestrictedResources { get; set; }

        /// <summary>
        /// Returns the string presentation of the object
        /// </summary>
        /// <returns>String presentation of the object</returns>
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();
            sb.Append("class CreateRestrictedDataTokenRequest {\n");
            sb.Append("  TargetApplication: ").Append(TargetApplication).Append("\n");
            sb.Append("  RestrictedResources: ").Append(RestrictedResources).Append("\n");
            sb.Append("}\n");
            return sb.ToString();
        }

        /// <summary>
        /// Returns the JSON string presentation of the object
        /// </summary>
        /// <returns>JSON string presentation of the object</returns>
        public virtual string ToJson()
        {
            return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
        }

        /// <summary>
        /// To validate all properties of the instance
        /// </summary>
        /// <param name="validationContext">Validation context</param>
        /// <returns>Validation Result</returns>
        IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
        {
            yield break;
        }
    }

}
